﻿using mediaControl.Vo;
using Prism.Mvvm;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace mediaControl.ViewModels
{

    public class Mp3PlayerViewModel : BindableBase
    {
        public Mp3PlayerViewModel(DialogParameters obj)
        {
            ProgramItemVo programItemVo = obj.GetValue<ProgramItemVo>("programItem");
            Volume = String.IsNullOrEmpty(programItemVo.Volume) ? 100 : Convert.ToInt16(programItemVo.Volume);
            MusicSrc = programItemVo.FilePath;
            StartWith = String.IsNullOrEmpty(programItemVo.StartWith) ? 0 : Convert.ToInt16(programItemVo.StartWith);
        }

        private string musicSrc;

        private int volume;

        private int startWith;

        public string Title { get; set; }
        public string MusicSrc { get { return musicSrc; } set { this.musicSrc = value; RaisePropertyChanged(); } }

        public int Volume { get { return volume; } set { this.volume = value; RaisePropertyChanged(); } }
        public int StartWith { get { return startWith; } set { this.startWith = value; RaisePropertyChanged();} }
    }
}
